#########################
#   Author : Leon yu    #
#   Date : 2025/06/12   #
#   Id : SM2772         #
#########################
from apiRespsAnalyze import *

# 数据解析
def queryDiscountDetailResult(startTime, endTime):
    result = dict()
    queryDiscountDetailReport = analyzeQueryDiscountDetailReport(startTime=startTime, endTime=endTime)
    # print(queryDiscountDetailReport)
    for item in queryDiscountDetailReport:
        result[item['discountId']] = {'orderCount':item['orderCount'], 'discountAmount' : abs(item['discountAmount']['amount'])}
    return result

